#include <iostream>
#include <cmath>
#include <iomanip>

class Solution
{
public:
    int main()
    {
        double s, v;
        std::cin >> s >> v;
        int timeConsumption = static_cast<int>(ceil(s / v)) + 10;
        int startTime = (1440 + 480 - timeConsumption) % 1440;
        int startHour = startTime / 60;
        int stratMinute = startTime % 60;
        std::cout << std::setw(2) << std::setfill('0') << startHour << ":" << std::setw(2) << std::setfill('0') << stratMinute;
        return 0;
    }
};

#ifndef __LOCAL_TEST__
int main()
{
    return Solution().main();
}
#endif